/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "question_title" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "QuestionTitle.findAll" , query = "SELECT q FROM QuestionTitle q" ) ,
    @NamedQuery( name = "QuestionTitle.findByQuestId" , query = "SELECT q FROM QuestionTitle q WHERE q.questId = :questId" ) ,
    @NamedQuery( name = "QuestionTitle.findByVersion" , query = "SELECT q FROM QuestionTitle q WHERE q.version = :version" ) ,
    @NamedQuery( name = "QuestionTitle.findByHeaderId" , query = "SELECT q FROM QuestionTitle q WHERE q.headerId = :headerId" ) ,
    @NamedQuery( name = "QuestionTitle.findByStatus" , query = "SELECT q FROM QuestionTitle q WHERE q.status = :status" ) ,
    @NamedQuery( name = "QuestionTitle.findByQuestLayout" , query = "SELECT q FROM QuestionTitle q WHERE q.questLayout = :questLayout" ) ,
    @NamedQuery( name = "QuestionTitle.findByTitle" , query = "SELECT q FROM QuestionTitle q WHERE q.title = :title" ) ,
    @NamedQuery( name = "QuestionTitle.findByQuestWording" , query = "SELECT q FROM QuestionTitle q WHERE q.questWording = :questWording" ) ,
    @NamedQuery( name = "QuestionTitle.findByLinesDollar" , query = "SELECT q FROM QuestionTitle q WHERE q.linesDollar = :linesDollar" ) ,
    @NamedQuery( name = "QuestionTitle.findByLinesPercent" , query = "SELECT q FROM QuestionTitle q WHERE q.linesPercent = :linesPercent" ) ,
    @NamedQuery( name = "QuestionTitle.findByCreatedBy" , query = "SELECT q FROM QuestionTitle q WHERE q.createdBy = :createdBy" ) ,
    @NamedQuery( name = "QuestionTitle.findByDateCreated" , query = "SELECT q FROM QuestionTitle q WHERE q.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "QuestionTitle.findByModifiedBy" , query = "SELECT q FROM QuestionTitle q WHERE q.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "QuestionTitle.findByDateModified" , query = "SELECT q FROM QuestionTitle q WHERE q.dateModified = :dateModified" ) ,
    @NamedQuery( name = "QuestionTitle.findByElectDescr" , query = "SELECT q FROM QuestionTitle q WHERE q.electDescr = :electDescr" ) ,
    @NamedQuery( name = "QuestionTitle.findByRefPeriod" , query = "SELECT q FROM QuestionTitle q WHERE q.refPeriod = :refPeriod" ) ,
    @NamedQuery( name = "QuestionTitle.findByInstanceOffset" , query = "SELECT q FROM QuestionTitle q WHERE q.instanceOffset = :instanceOffset" ) ,
    @NamedQuery( name = "QuestionTitle.findByInstanceIndex" , query = "SELECT q FROM QuestionTitle q WHERE q.instanceIndex = :instanceIndex" )
} )
public class QuestionTitle implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic( optional = false )
    @Column( name = "quest_id" )
    private String questId;
    @Basic( optional = false )
    @Column( name = "version" )
    private BigInteger version;
    @Column( name = "header_id" )
    private String headerId;
    @Basic( optional = false )
    @Column( name = "status" )
    private String status;
    @Column( name = "quest_layout" )
    private String questLayout;
    @Column( name = "title" )
    private String title;
    @Column( name = "quest_wording" )
    private String questWording;
    @Column( name = "lines_dollar" )
    private Character linesDollar;
    @Column( name = "lines_percent" )
    private Character linesPercent;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;
    @Column( name = "elect_descr" )
    private String electDescr;
    @Basic( optional = false )
    @Column( name = "ref_period" )
    private String refPeriod;
    @Column( name = "instance_offset" )
    private BigInteger instanceOffset;
    @Column( name = "instance_index" )
    private BigInteger instanceIndex;
    @JoinColumn( name = "category_content_id" , referencedColumnName = "category_content_id" )
    @ManyToOne( optional = false )
    private CategoryContent categoryContentId;
    @OneToMany( cascade = CascadeType.ALL , mappedBy = "questId" )
    private Collection<QuestionnaireQuestions> questionnaireQuestionsCollection;
    @OneToMany( cascade = CascadeType.ALL , mappedBy = "questId" )
    private Collection<CustomContentLayouts> customContentLayoutsCollection;
    @OneToMany( cascade = CascadeType.ALL , mappedBy = "questId" )
    private Collection<CustomContentItems> customContentItemsCollection;


    public QuestionTitle()
    {
    }


    public QuestionTitle( String questId )
    {
        this.questId = questId;
    }


    public QuestionTitle( String questId , BigInteger version , String status , String createdBy , Date dateCreated , String refPeriod )
    {
        this.questId = questId;
        this.version = version;
        this.status = status;
        this.createdBy = createdBy;
        this.dateCreated = dateCreated;
        this.refPeriod = refPeriod;
    }


    public String getQuestId()
    {
        return questId;
    }


    public void setQuestId( String questId )
    {
        this.questId = questId;
    }


    public BigInteger getVersion()
    {
        return version;
    }


    public void setVersion( BigInteger version )
    {
        this.version = version;
    }


    public String getHeaderId()
    {
        return headerId;
    }


    public void setHeaderId( String headerId )
    {
        this.headerId = headerId;
    }


    public String getStatus()
    {
        return status;
    }


    public void setStatus( String status )
    {
        this.status = status;
    }


    public String getQuestLayout()
    {
        return questLayout;
    }


    public void setQuestLayout( String questLayout )
    {
        this.questLayout = questLayout;
    }


    public String getTitle()
    {
        return title;
    }


    public void setTitle( String title )
    {
        this.title = title;
    }


    public String getQuestWording()
    {
        return questWording;
    }


    public void setQuestWording( String questWording )
    {
        this.questWording = questWording;
    }


    public Character getLinesDollar()
    {
        return linesDollar;
    }


    public void setLinesDollar( Character linesDollar )
    {
        this.linesDollar = linesDollar;
    }


    public Character getLinesPercent()
    {
        return linesPercent;
    }


    public void setLinesPercent( Character linesPercent )
    {
        this.linesPercent = linesPercent;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    public String getElectDescr()
    {
        return electDescr;
    }


    public void setElectDescr( String electDescr )
    {
        this.electDescr = electDescr;
    }


    public String getRefPeriod()
    {
        return refPeriod;
    }


    public void setRefPeriod( String refPeriod )
    {
        this.refPeriod = refPeriod;
    }


    public BigInteger getInstanceOffset()
    {
        return instanceOffset;
    }


    public void setInstanceOffset( BigInteger instanceOffset )
    {
        this.instanceOffset = instanceOffset;
    }


    public BigInteger getInstanceIndex()
    {
        return instanceIndex;
    }


    public void setInstanceIndex( BigInteger instanceIndex )
    {
        this.instanceIndex = instanceIndex;
    }


    public CategoryContent getCategoryContentId()
    {
        return categoryContentId;
    }


    public void setCategoryContentId( CategoryContent categoryContentId )
    {
        this.categoryContentId = categoryContentId;
    }


    @XmlTransient
    public Collection<QuestionnaireQuestions> getQuestionnaireQuestionsCollection()
    {
        return questionnaireQuestionsCollection;
    }


    public void setQuestionnaireQuestionsCollection( Collection<QuestionnaireQuestions> questionnaireQuestionsCollection )
    {
        this.questionnaireQuestionsCollection = questionnaireQuestionsCollection;
    }


    @XmlTransient
    public Collection<CustomContentLayouts> getCustomContentLayoutsCollection()
    {
        return customContentLayoutsCollection;
    }


    public void setCustomContentLayoutsCollection( Collection<CustomContentLayouts> customContentLayoutsCollection )
    {
        this.customContentLayoutsCollection = customContentLayoutsCollection;
    }


    @XmlTransient
    public Collection<CustomContentItems> getCustomContentItemsCollection()
    {
        return customContentItemsCollection;
    }


    public void setCustomContentItemsCollection( Collection<CustomContentItems> customContentItemsCollection )
    {
        this.customContentItemsCollection = customContentItemsCollection;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( questId != null ? questId.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof QuestionTitle ) )
        {
            return false;
        }
        QuestionTitle other = (QuestionTitle) object;
        if ( ( this.questId == null && other.questId != null ) || ( this.questId != null && !this.questId.equals( other.questId ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.QuestionTitle[ questId=" + questId + " ]";
    }
    
}
